package com.java.demo;

import com.java.demo.component.BeanComponent;
import com.java.demo.controller.UserController;
import com.java.demo.controller.UserController2;
import com.java.demo.enity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        UserController userController = context.getBean("userController",UserController.class);
        userController.printUser();
//
//        UserController2 userController2 = context.getBean("userController2",UserController2.class);
//        userController2.printUser2();

//        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
//        BeanComponent component = context.getBean("beanComponent",BeanComponent.class);
//        component.sayHi();
//        context.destroy();

    }
}
